package com.xbongbong.saas.domain.dao;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.saas.domain.entity.WorkOrderStageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2019/3/7 10:58
 * @since v1.0
 * @version v1.0
 */
@Repository
@Mapper
public interface WorkOrderStageDao {

    Integer insert(WorkOrderStageEntity entity);

    Integer update(WorkOrderStageEntity entity);

    List<WorkOrderStageEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    Integer delete(@Param("param") Map<String, Object> param);

    WorkOrderStageEntity getNextStage(@Param("param") Map<String, Object> param);

    WorkOrderStageEntity getByKey(@Param("key") Long stageId, @Param("corpid") String corpid);

    WorkOrderStageEntity getPreStage(@Param("param") Map<String,Object> param);

    List<Long> getPreStageList(@Param("param") Map<String,Object> param);

    WorkOrderStageEntity getFirstStage(@Param("templateId") Long templateId, @Param("corpid") String corpid);
    /**
     * 批量删除
     * @param list 主键id集合
     * @param corpid
     * @author xingxing.xiao
     */
    Integer deleteBatch(@Param("list") List<Long> list, @Param("corpid") String corpid);

    Integer updateBatch(@Param("list") List<WorkOrderStageEntity> list ,@Param("corpid") String corpid);

}
